#!/usr/bin/env python

from random import *
from datetime import *
from cgi import FieldStorage

form = FieldStorage()

callback = form['callback'].value

data = {
    'a': randint(0, 100),
    'b': 0,
}

if form.has_key('b'):
    data['b'] = form['b'].value

print 'Content-type: text/plain'
print
print '%s(%s);' % (callback, repr(data))

#        headel("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
#        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
#        header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1
#        header("Cache-Control: post-check=0, pre-check=0", false);
#        header("Pragma: no-cache"); // HTTP/1.0
